package com.jie.component.init.config;

import com.jie.common.util.LogUtil;
import com.jie.component.init.core.ApplicationCommandLineRunnerExecute;
import com.jie.component.init.core.ApplicationInitializingBeanExecute;
import com.jie.component.init.core.ApplicationPostConstructExecute;
import com.jie.component.init.core.ApplicationStartEventListenerExecute;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;

public class InitializeAutoConfig {

    @Bean
    public ApplicationInitializingBeanExecute applicationInitializingBeanExecute(
            ConfigurableApplicationContext applicationContext) {
        LogUtil.autoConfigLog("ApplicationInitializingBeanExecute");
        return new ApplicationInitializingBeanExecute(applicationContext);
    }

    @Bean
    public ApplicationPostConstructExecute applicationPostConstructExecute(
            ConfigurableApplicationContext applicationContext) {
        LogUtil.autoConfigLog("ApplicationPostConstructExecute");
        return new ApplicationPostConstructExecute(applicationContext);
    }

    @Bean
    public ApplicationStartEventListenerExecute applicationStartEventListenerExecute(
            ConfigurableApplicationContext applicationContext) {
        LogUtil.autoConfigLog("ApplicationStartEventListenerExecute");
        return new ApplicationStartEventListenerExecute(applicationContext);
    }

    @Bean
    public ApplicationCommandLineRunnerExecute applicationCommandLineRunnerExecute(
            ConfigurableApplicationContext applicationContext) {
        LogUtil.autoConfigLog("ApplicationCommandLineRunnerExecute");
        return new ApplicationCommandLineRunnerExecute(applicationContext);
    }
}